import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-06-26
 * Time: 13:43
 */
public class Test {
    public static void removeData(String str1,String str2,ArrayList<Character> list) {
        int size = str1.length();
        for (int i = 0; i < size; i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch+"")) {//注意这里！神来之笔！技巧：字符型+"" 就得到了一个字符串！！！
                list.add(ch);
            }
        }
    }
    public static void main(String[] args) {
        ArrayList<Character> list = new ArrayList<>();
        String str1 = "Welcome to China!";
        String str2 = "Wow!Grand!";
        removeData(str1,str2,list);
        int size = list.size();
        for (int i = 0; i < size; i++) {
            System.out.print(list.get(i));
        }
        System.out.println();//习惯性换行
    }
}
